<?php
namespace UHU;

class _server
{
/**
*	@var uhu_request_config|null holds an instance of uhu_request_config 
*	@see http://uk.php.net/singleton
*/
	protected static $instance = null;
/**
*	integer the compression level to use with Gzip. Will probably be moved to {@link uhu_install_config}
*/
	const GZIP_COMPRESSION_LEVEL = 9;
/**
*	@var bool|null TRUE if the user agent supports Gzip compression, FALSE otherwise
*/
	protected $gzip = null;
/**
*	An implementation of the singleton pattern
*	@uses uhu_request_config::$gzip
*/
	protected function __construct()
	{
		$this->gzip = (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'],'gzip') !== false);
	}
/**
*	An implementation of the singleton pattern
*	@uses uhu_request_config::$instance
*/
	public static function getInstance()
	{
		if(!self::$instance instanceof self)
		{
			self::$instance = new self;
		}
		return self::$instance;
	}
/**
*	@return bool TRUE if the user agent supports Gzip compression, FALSE otherwise
*	@uses uhu_request_config::$gzip
*/
	public function gzip()
	{
		return $this->gzip;
	}
}
?>